package ch.evaleto.gwt.media.client.player.util;

import java.util.ArrayList;
import java.util.List;

public abstract class EventListenerList {
	private List<EventListener> events;
	public EventListenerList() {
		events = new ArrayList<EventListener>();
	}
	
	public void call(String name,Object sender) {
		for (EventListener event:events)
			callEvent(name, event, sender);
	}
	
	abstract public void callEvent(String name, EventListener event, Object sender);

	public void add(EventListener listener){
		events.add(listener);
	}


	public void remove(EventListener listener) {
		events.remove(listener);
	}	
}
